package com.appistry.storage;

import java.net.InetAddress;

import com.appistry.storage.exception.StorageManagerException;

public interface Worker {
	/**
	 * Returns the ip address of this worker
	 * @return
	 */
	public String getIpAddress();

	/**
	 * Returns the InetAddress of this worker
	 * @return
	 */
	public InetAddress getInetAddress();

	/**
	 * Returns the WorkerInfo of this worker
	 * 
	 * @return
	 * @throws StorageManagerException
	 */
	public WorkerInfo getWorkerInfo() throws StorageManagerException;
	
	/**
	 * Returns the port the service is running on
	 * @return
	 */
	public int getPort();
	
	/**
	 * Returns the availability of the worker
	 * @return
	 */
	public boolean isAvailable();

	/**
	 * Returns the territory this worker belongs to
	 * 
	 * @return
	 * @throws StorageManagerException
	 */
	public String getTerritory() throws StorageManagerException;

	/**
	 * Returns the worker configuration
	 * 
	 * @return
	 * @throws StorageManagerException
	 */
	public WorkerConfiguration getWorkerConfiguration() throws StorageManagerException;

	/**
	 * Starts this worker
	 * @throws StorageManagerException
	 */
	public void start() throws StorageManagerException;

	/**
	 * Stops this worker
	 * @throws StorageManagerException
	 */
	public void stop() throws StorageManagerException;
}
